const moduleA = {
    state: {
        counter: 88,
        msg: '你好 Vuex module！',
    },
    getters: {

    },
    mutations: {
        SET_COUNTER(state, opt) {
            if (opt === '+') {
                state.counter++
            } else {
                state.counter--
            }
        }
    },
    actions: {
        addAction(context) {
            context.commit('SET_COUNTER', '+')
        },
        incAction({commit}) {
            commit('SET_COUNTER', '-')
        }
    },
    namespaced: true, // 给模块添加命名空间
}

export default moduleA